# Description:
#   Integration test runner + corpus for Java port of Brotli decoder.

java_library(
    name = "brotli_jni_test_base",
    srcs = ["BrotliJniTestBase.java"],
    visibility = [
        "//org/brotli/wrapper/common:__pkg__",
        "//org/brotli/wrapper/dec:__pkg__",
        "//org/brotli/wrapper/enc:__pkg__",
    ],
)

java_library(
    name = "bundle_helper",
    srcs = ["BundleHelper.java"],
    visibility = [
        "//org/brotli/wrapper/dec:__pkg__",
        "//org/brotli/wrapper/enc:__pkg__",
    ],
)

java_library(
    name = "bundle_checker",
    srcs = ["BundleChecker.java"],
    runtime_deps = ["//org/brotli/dec"],
    deps = [
        ":bundle_helper",
        "//org/brotli/dec:test_utils",
    ],
)

java_binary(
    name = "bundle_checker_bin",
    main_class = "org.brotli.integration.BundleChecker",
    runtime_deps = [":bundle_checker"],
)

java_test(
    name = "bundle_checker_data_test",
    args = ["$(location :test_data)"],
    data = [":test_data"],
    main_class = "org.brotli.integration.BundleChecker",
    use_testrunner = 0,
    runtime_deps = [":bundle_checker"],
)

java_test(
    name = "bundle_checker_fuzz_test",
    args = [
        "-s",
        "$(location :fuzz_data)",
    ],
    data = [":fuzz_data"],
    main_class = "org.brotli.integration.BundleChecker",
    use_testrunner = 0,
    runtime_deps = [":bundle_checker"],
)

filegroup(
    name = "fuzz_data",
    srcs = ["fuzz_data.zip"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "test_data",
    srcs = ["test_data.zip"],
    visibility = ["//org/brotli/wrapper/dec:__pkg__"],
)

filegroup(
    name = "test_corpus",
    srcs = ["test_corpus.zip"],
    visibility = ["//org/brotli/wrapper/enc:__pkg__"],
)
